<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">

var fbloaded = f_loaded = is_reload = false;
var appid				= '152111258156947';
var p_user 				= <?php echo $p_user ?>;
var g_user 				= <?php echo json_encode($g_user); ?>;
var friends				= <?php echo $friends ?>;
var is_register			= '<?php echo $is_register ?>';
var is_firstin			= '<?php echo $is_firstin ?>';

var flashvars	= {};

flashvars.mnick 	= p_user.name;
flashvars.sex		= p_user.sex;
flashvars.avatar	= {
	"icon": 	"http://graph.facebook.com/cosnis/picture",
	"middle": 	"http://graph.facebook.com/cosnis/picture?type=small",
	"big": 		"http://graph.facebook.com/cosnis/picture?type=normal"
};
flashvars.is_register = 1;
flashvars.is_firstin  = 1; // is_firstin

<?php
foreach($fv as $k => $v) {
	echo "flashvars.$k = " . json_encode($v) . ";
";
}
?>

function page_reload() {
	top.location.reload();
}

function get_userdata() {
	return flashvars;
}

function getFlashMovieObject(movieName){
	if (window.document[movieName]){
		return window.document[movieName];
	}else if (navigator.appName.indexOf("Microsoft")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}else{
		return document.getElementById(movieName);
	}
}

swfobject.embedSWF(
	'<?php echo $app_swf_path ?>',
	"flashcontent",
	"760",
	"610",
	"9.0.0",
	"expressInstall.swf",
	{},
	{
		"allowScriptAccess": "always",
		"allowFullScreen": "true"
	}
);

function goGame() {
	$('#flashcontainer').css('top', '100px');
	$('#boxes').html('');
}

function showFansContainer() {
	alert('调用 显示 添加到fans的容器');
}

function log(str) {
	if(typeof console != 'undefined') {
		console.log(str);
	}
}
</script>
</head><body>
<h1 style="display: inline;">扎金花</h1>
mid: <?php echo $fv['mid'] ?> |
sesskey：<?php echo $fv['mtkey'] ?> |
<a href="http://192.168.56.110/__account_common/">切换用户</a> | <br/><br/>
<hr />

<a href="javascript: goGame();">遊戲</a>
<hr />
<div id="flashcontainer" style="position: absolute;">
	<div id="flashcontent">need flash</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	goGame();
});
</script>
</body>
</html>
